<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>留言板</title>
	<link rel="stylesheet" type="text/css" href="./css/style.css"/>
</head>
<body>
	<div class="main">
		<h2>
			<span>留言板</span>
			<p>目前有<?php echo count($mysql)?>条精彩留言</p>
		</h2>
		<?php 
			if(count($mysql)==0){
		?>
			<div class="meiren">还没有人留言哦，快来吧O(∩_∩)O~</div>
		<?php }else{
			foreach ($mysql as $key => $value) {
			$time = $value['time'];
			
		?>

		<div class="show">
			<img src="./img/<?php echo $value['img']?>.png">
			<div class="rt">
				<p>
					<span class="user"><?php echo $value['user'];?></span>
					<strong><?php echo ($value['gender']==0)?'♂':'♀'?></strong>
					<span class="time">发表于：<?php echo " {$time['year']}年 {$time['mon']} 月 {$time['day']} 日 {$time['hours']}:{$time['minutes']}:{$time['seconds']}";?></span>
					<i class="floor"><?php echo '#'.($key+1)?></i>
				</p>
				<div class="mes">
					<?php echo $value['text']?>
				</div>
				<a  class="del" href="javascript:;" onclick="if(confirm('确定删除吗亲！')){window.location='index.php?action=delete&id=<?php echo $key?>';}">删除</a>
				<a class="change" href="index.php?action=change&id=<?php echo $key?>">修改</a>
			</div>	
		</div>
		<?php 
				}
			} 
	?>
		<form class="speak" action="" method="post">
			<h3>发表评论</h3>
			<p><span>姓&nbsp;&nbsp;&nbsp;名：</span> <input class="user" type="text" name="user" placeholder="路人"/></p>
			<p>
				<span>性&nbsp;&nbsp;别：</span>
				<input  type="radio" name="gender" class="gender" value="0" checked='checked'/>男
				<input  type="radio" name="gender" class="gender" value="1"/>女
			</p>
			<p>
				<span>验证码：</span><input class="user" type="text" name="yzm"/>
				<i style="color:red; font-size:12px"><?php echo $notice?></i>
			</p>
			<div class="yzm_out">
				<div class="yzm">
					<?php echo $yzm = yzm(); ?> <!-- 获取验证码 -->
				</div>
			</div>
			<div class="touxiang">
				<h4>头像选择</h4>
				<div class="tx_img">
					<img src="./img/img1.png"></img>
					<input type="radio" name="img"  value="img1" checked="checked"/>
				</div>
				<div class="tx_img">
					<img src="./img/img2.png"></img>
					<input type="radio" name="img" value="img2"  />
				</div>
				<div class="tx_img">
					<img src="./img/img3.png"></img>
					<input type="radio" name="img" value="img3" />
				</div>
				<div class="tx_img">
					<img src="./img/img4.png"></img>
					<input type="radio" name="img" value="img4" />
				</div>
				<div class="tx_img">
					<img src="./img/img5.png"></img>
					<input type="radio" name="img" value="img5" />
				</div>
				<div class="tx_img">
					<img src="./img/img6.png"></img>
					<input type="radio" name="img" value="img6" />
				</div>
				<div class="tx_img">
					<img src="./img/img7.png"></img>
					<input type="radio" name="img" value="img7" />
				</div>
				<div class="tx_img">
					<img src="./img/img8.png"></img>
					<input type="radio" name="img" value="img8" />
				</div>
			</div>
			<h5 style="color:red;"><?php echo $notice_text?></h5>
			<textarea type="text" name="text" placeholder="写点什么吧" ></textarea>
			<input class="sub" type="submit" value=""/>

		</form>
		
	</div>
	<div class="caver" id="caver"></div>
	<form id="change_show" class="show change_show" action="index.php" method="post">
			<img src="./img/<?php echo $mes_change['img']?>.png">
			<div class="rt">
				<p>
					<span class="user"><?php echo $mes_change['user'];?></span>
					<strong><?php echo ($mes_change['gender']==0)?'♂':'♀'?></strong>
					<span class="time">发表于：<?php $time_change=$mes_change['time']; echo " {$time_change['year']}年 {$time_change['mon']} 月 {$time_change['day']} 日 {$time_change['hours']}:{$time_change['minutes']}:{$time_change['seconds']}";?></span>
					<i class="floor"><?php echo '#'.($Id+1)?></i>
				</p>
				<textarea class="mes" name="text"><?php echo $mes_change['text']?></textarea>
				<input type="hidden" name="Id" value="<?php echo $Id?>"/>
				<div class="sub">
					<input type="submit" value="提交"/>
					<input type="button" value="取消" onclick="window.location='index.php';"/>
				</div>
				
			</div>	
	</form>
	
</body>
</html>